﻿using System;
using UnityEngine;

namespace SteeringBehaviors
{
	// Token: 0x0200021F RID: 543
	public class Wander : Seek
	{
		// Token: 0x06000B5B RID: 2907 RVA: 0x0005F62C File Offset: 0x0005D82C
		public Wander(MovementCharacter agent) : base(agent, null, 0f, 0f)
		{
			this.target = new VectorKinematic(agent.transform.position);
		}

		// Token: 0x1700015C RID: 348
		// (get) Token: 0x06000B5C RID: 2908 RVA: 0x0005F682 File Offset: 0x0005D882
		public float Offset
		{
			get
			{
				return this.offset * this.agent.scale;
			}
		}

		// Token: 0x1700015D RID: 349
		// (get) Token: 0x06000B5D RID: 2909 RVA: 0x0005F696 File Offset: 0x0005D896
		public float Radius
		{
			get
			{
				return this.radius * this.agent.scale;
			}
		}

		// Token: 0x06000B5E RID: 2910 RVA: 0x0005F6AC File Offset: 0x0005D8AC
		public override SteeringOutput GetSteering()
		{
			this.wanderOrientation += base.RandomBinomial() * this.rate;
			float orientation = this.wanderOrientation + this.agent.orientation;
			Vector3 a = base.OrientationToVector(this.agent.orientation);
			Vector3 vector = this.Offset * a + this.agent.transform.position;
			vector += base.OrientationToVector(orientation) * this.Radius;
			this.target.position = vector;
			return base.GetSteering();
		}

		// Token: 0x0400106F RID: 4207
		public float offset = 2f;

		// Token: 0x04001070 RID: 4208
		public float radius = 1f;

		// Token: 0x04001071 RID: 4209
		public float rate = 30f;

		// Token: 0x04001072 RID: 4210
		private float wanderOrientation;
	}
}
